POV-Ray : Newsgroups : povray.general : Status of Moray? : Re: New SDL for POVRay Server Time
28 Apr 2024 18:44:17 EDT (-0400)
  Re: New SDL for POVRay  
From: Warp
Date: 31 Oct 2007 08:04:09
Message: <47287d49@news.povray.org>
Patrick Elliott <sel### [at] rraznet> wrote:
> Your code, more or less:

> Frame 1:
> Define array1, array2, array3.

  That's not "my code". Its your idea of what "my code" is.

  Why are you so obsessed with the arrays? How many times do I have to
repeat that the arrays are not needed?

  Your array solution consists of two steps:

1) Initialize the arrays at the beginning.
2) Execute some code at each frame which modifies the arrays.

  The proper solution is:

1) Execute some code at each frame which transforms the objects.

  Basically your step 1 has been removed and only step 2 remains.
No arrays needed.

  Perhaps you are confused by "execute some code at each frame"? Do you
perhaps think that means that the user has to write some code for each
single frame in the animation? Maybe that's what you are not comfortable
with?

  No, the code is written just once. The SDL interpreter executes it at
each frame.
  It's the same idea as with loops (as I have mentioned before): Even though
the body of the loop is executed many times, the programmer only has to
write it once and that's it. The exact same idea with the transformations:
You write them once and the interpreter executes them at each frame.

  Your arrays wouldn't be of much help in this, but would add one layer
of complexity. Instead of having *one* piece of code which is executed at
each frame, you would need *two* pieces of code: One to initialize the
arrays and a second one to modify those arrays at each frame if needed.
  (Of course you can have two pieces of code like this if you want to,
but the idea is to not to force it.)

  Moreover, since the code which initializes your array is basically the
same code which applies the transformations, that makes the array itself
obsolete. The transformations can be applied to the object directly,
without the need to store them in an array.

> My code, more or less:

> Frame 1:
> Define table1.
> Frame 3:
> Change something in table1.

  That's exactly where the two steps are which you couldn't see.
You have to be somehow able to tell the interpreter "at frame 3 execute
these commands".

> Feel free to rant some more about it. But this time, please give a clear 
> explanation for how you manage to do this *without* basically doing what 
> I described, or by, worse, not allowing someone to apply a table to the 
> whole nest of objects at all, but making them do it one at a time (which 
> is imho damn silly, since it not only disassociates the data from the 
> object, it disassociates the data from other related data).

  The user applies the transformations to the objects in the exact same
way as they would apply those transformations to your arrays, but instead
of being applied to the useless arrays, they are applied to the objects
directly.

  It somehow seems that you have this concept that the user would have
to literally write n pieces of transformation code for an animation with
n frames. No, the user writes the transformations just once, and they
are executed at each frame.

-- 
                                                          - Warp


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.